package thread;

import java.util.concurrent.BlockingDeque;
import java.util.concurrent.LinkedBlockingDeque;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 刘远望
 * Date: 2025-05-27
 * Time: 18:44
 */
public class Demo29 {
    public static void main(String[] args) throws InterruptedException {
        BlockingDeque<String> queue = new LinkedBlockingDeque<>(100);

        for (int i = 0; i < 100; i++) {
            queue.put("abc");
        }
        System.out.println("队列已经满了");

        queue.put("666");//这里就会阻塞可以通过jcosole查看线程的状态(跟踪线程)
        System.out.println("再次尝试put元素");
    }
}
